package com.todo.member.infrastructure.repository;

import com.todo.common.common.entity.response.page.PageResult;
import com.todo.member.common.enums.MedalStatusEnum;
import com.todo.member.infrastructure.entity.condition.MemberMedalInfoCondition;
import com.todo.member.infrastructure.entity.po.MemberMedalInfoPO;
import com.todo.member.infrastructure.entity.po.MemberMedalUserRelationPO;

import java.util.List;

/**
 * @author azhebuxing
 * @date 2025/2/10 11:34
 * @description
 */
public interface MemberMedalInfoRepository {

    /**
     * 插入会员勋章信息
     *
     * @param memberMedalInfoPO
     * @return
     */
    Boolean insertMemberMedalInfo(MemberMedalInfoPO memberMedalInfoPO);

    /**
     * 更新会员勋章信息
     *
     * @param memberMedalInfoPO
     * @return
     */
    Boolean updateMemberMedalInfo(MemberMedalInfoPO memberMedalInfoPO);

    /**
     * 根据主键查询会员勋章信息
     *
     * @param id
     * @return
     */
    MemberMedalInfoPO queryMemberMedalInfoById(Long id);

    /**
     * 根据主键删除会员勋章信息
     *
     * @param id
     * @return
     */
    Boolean removeMemberMedalInfoById(Long id);

    /**
     * 根据勋章编码查询会员勋章信息
     *
     * @param medalCode
     * @return
     */
    MemberMedalInfoPO queryMemberMedalInfoByMedalCode(String medalCode);

    /**
     * 根据标题查询会员勋章信息
     *
     * @param title
     * @return
     */
    MemberMedalInfoPO queryMemberMedalInfoByTitle(String title);

    /**
     * 多条件查询会员勋章信息
     *
     * @param memberMedalInfoCondition
     * @return
     */
    PageResult<MemberMedalInfoPO> queryMemberMedalInfoByCondition(MemberMedalInfoCondition memberMedalInfoCondition);

    /**
     * 新增会员勋章记录
     *
     * @param memberMedalUserRelationPO
     * @return
     */
    Boolean insertMemberMedalRecord(MemberMedalUserRelationPO memberMedalUserRelationPO);

    /**
     * 根据用户id查询会员勋章记录
     *
     * @param userId
     * @return
     */
    List<MemberMedalUserRelationPO> queryMemberMedalRecordByUserId(Long userId);

    /**
     * 更新会员勋章状态
     *
     * @param id
     * @param oldStatus
     * @param newStatus
     */
    Boolean updateMemberMedalInfoStatusById(Long id, MedalStatusEnum oldStatus, MedalStatusEnum newStatus);
}
